package com.simple.business.service.user;


import com.github.zuihou.base.R;
import com.github.zuihou.base.service.SuperService;
import com.simple.business.domain.dto.sms.LoginDTO;
import com.simple.business.domain.dto.sms.UserPwdChangeDTO;
import com.simple.business.domain.dto.sms.UserRegisterDTO;
import com.simple.business.domain.dto.sms.VerificationCodeDTO;
import com.simple.business.domain.entity.user.User;
import com.simple.business.domain.vo.login.UserLoginSuccessVO;


public interface UserService extends SuperService<User> {

    /**
     * 根据用户名获取用户
     * @param userName
     * @return
     */
    User getUserByUserName(String userName);

    /**
     * 普通账号密码注册
     */
    R<UserLoginSuccessVO> register(UserRegisterDTO userRegisterDTO);

    /**
     * 手机发送验证码
     * @param dto
     * @return
     */
    R<String> sendSms(VerificationCodeDTO dto);

    /**
     * 绑定手机
     * @param dto
     * @return
     */
    R<Boolean> bindPhoneOrEmail(LoginDTO dto);

    /**
     * 普通账号密码登录
     */
    UserLoginSuccessVO login(String userName, String pwd);

    /**
     * 修改密码
     */
    R<Boolean> changePwd(UserPwdChangeDTO dto);

    /**
     * 重置密码
     */
    R<Boolean> resetPwd();


    /**
     * 判断当前账号是否和输入账号一致
     * @param account
     * @return
     */
    boolean accountExist(String account);

    /**
     * 生成登录成功的用户身份code，用户未登录下手机号码绑定和再次登录
     */
    String genIdCode(UserLoginSuccessVO loginSuccessVO);

    R<UserLoginSuccessVO> simpleRegister(String randomAccount);

    UserLoginSuccessVO loginByUserId(Long userId);

    R<UserLoginSuccessVO> loginByThirdAccount(LoginDTO loginDTO);
}
